<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:p="http://primefaces.org/ui"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/adminTheme.xhtml">
	<ui:define name="content-header">
		<section class="content-header">
			<h1>
				View Detail<small>View Code</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#{request.contextPath}/admin/"><i
						class="fa fa-dashboard"></i> Home</a></li>
				<li><a href="#{request.contextPath}/admin/code/view.html">View
						Code</a></li>
				<li class="active">Edit</li>
			</ol>
		</section>
	</ui:define>
	<ui:define name="content-main">
		<!-- Small boxes (Stat box) -->
		<div class="row">
			<div class="col-md-12">
			<p:messages id="messages" showDetail="true" autoUpdate="true"
							closable="true" />
			
				<h:form>
					<div class="box box-primary">
						<div class="box-header">
							<h3 class="box-title">Edit Code :</h3>
							<p:selectOneMenu value="#{vcb.selectEdit}" converter="#{cc}">
								<f:selectItems value="#{vcb.selectView}" var="code" itemLabel="#{code.codeNo}" itemValue="#{code}" />
								<p:ajax listener="#{vcb.loadEditTmp()}" update="input-code"></p:ajax>
							</p:selectOneMenu>
							
						</div>
						<h:panelGroup id="input-code">
						<div class="box-body">
							<div class="form-group" >
								<h:outputLabel value="Code ID:" for="codeNo" />
								<h:inputText styleClass="form-control" id="codeNo" value="#{vcb.selectEditTmp.codeNo}" />
							</div>
							<div class="form-group" >
								<h:outputLabel value="Code Name:" for="codeName" />
								<h:inputText styleClass="form-control" id="codeName" value="#{vcb.selectEditTmp.codeName}"/>
							</div>
						</div>
						</h:panelGroup>
						<div class="box-footer">
							<p:commandButton styleClass="btn btn-primary"  value="Save" action="#{vcb.updateCode}" update=":messages input-code"></p:commandButton>
							<p:commandButton styleClass="btn btn-primary"  value="Cancel" action="#{vcb.loadEditTmp()}" update=":messages input-code"></p:commandButton>
						</div>
					</div>
				</h:form>
				
			</div>
		</div>

		<!-- /.row (main row) -->
	</ui:define>



</ui:composition>